<template>
<view>
<view class="news-details" style="padding: 0 20rpx;">
   
    <view class="main">
        <u-parse :html="article_content" />
		
    </view>
</view>
<loading-view v-if="showLoading"></loading-view>
</view>
</template>

<script>

import { getArticleDetail } from '@/api/store';

export default {
  data() {
    return {
	  aid:0,
	  id:0,
      showLoading: true,
      articleDetail: {},
      article_content: ""
    };
  },

  components: {
  },
  props: {},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
	  console.log('====options===========');
	  console.log(options);
    this.type = Number(options.type) || '';
	if(this.$route){
		this.id = this.$route.query.id || 0;
		this.aid = this.$route.query.aid || 0;
	}
    this.id = this.id || options.id || 0;
	this.aid = this.aid || options.aid || 0;

    if (this.type) {
      uni.setNavigationBarTitle({
        title: '帮助详情'
      });
    } else {
      uni.setNavigationBarTitle({
        title: '关于我们'
      });
    }
    this.getArticleDetailFun();
  },

 
  methods: {
    getArticleDetailFun() {
      getArticleDetail({
        type: this.type,
        id: this.id,
		aid: this.aid,
      }).then(res => {
        if (res.code == 1) {
          this.articleDetail = res.data
          setTimeout(() => {
            this.article_content = res.data.content;
          }, 200);
          setTimeout(() => {
              this.showLoading = false
          }, 300);
		  
        }
      });
    }

  }
};
</script>
<style lang="scss">
page {
    background-color: #fff;
	
}
.news-details .header{
    padding: 20rpx 15px;
    border-bottom: $-solid-border;
}
.news-details .main {
  
}

</style>